﻿using Sustainalytics.Entities;
using System;

namespace Sustainalytics.Claims
{
    public static class AccountExtensions
    {
        private const string _separator = "#@%";

        public static string GetNameIdKey(this UserClaim userClaims)
        {
            return GetNameIdKey(userClaims.Account, userClaims.Id);
        }

        public static string GetNameIdKey(this Account account)
        {
            return GetNameIdKey(account.Name, account.Id);
        }

        private static string GetNameIdKey(string accName, Guid id)
        {
            return accName + _separator + id.ToString();
        }
    }
}
